package com.happyclub.pojo;

import javax.persistence.*;
import java.sql.Time;
import java.util.Objects;

/**
 * @author 高欢
 * @description TODO
 * @date 2019/4/4
 */
@Entity
@Table(name = "TB_TRAVEL_PHOTO_ALBUM", schema = "SCOTT", catalog = "")
@IdClass(TbTravelPhotoAlbumPK.class)
public class TbTravelPhotoAlbum {
    private String travelId;
    private String photoAlbumId;
    private Time updateTime;
    private Time createTime;

    @Id
    @Column(name = "TRAVEL_ID")
    public String getTravelId() {
        return travelId;
    }

    public void setTravelId(String travelId) {
        this.travelId = travelId;
    }

    @Id
    @Column(name = "PHOTO_ALBUM_ID")
    public String getPhotoAlbumId() {
        return photoAlbumId;
    }

    public void setPhotoAlbumId(String photoAlbumId) {
        this.photoAlbumId = photoAlbumId;
    }

    @Basic
    @Column(name = "UPDATE_TIME")
    public Time getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Time updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "CREATE_TIME")
    public Time getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Time createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TbTravelPhotoAlbum that = (TbTravelPhotoAlbum) o;
        return Objects.equals(travelId, that.travelId) &&
                Objects.equals(photoAlbumId, that.photoAlbumId) &&
                Objects.equals(updateTime, that.updateTime) &&
                Objects.equals(createTime, that.createTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(travelId, photoAlbumId, updateTime, createTime);
    }
}
